// import request from './request'
import request from './axios'

export const ProdBaseUrl = 'https://api.sczgss.com/admin/'
export const developBaseUrl = 'https://api.sczgss.com/admin/'
/**
 * 
 * @returns 
 * 获取个人的菜单导航栏信息
 */
export const getUserMenu = () => {
    return request({
        url: '/getAdminUserMenu',
        method: 'get'
    })
}
/**
 * 
 * @param {*} data  上传的图片地址
 * @returns 
 */
export const uploadImg = (data) => {
    return request({
        url: '/Upload/image',
        method: 'post',
        data,
        headers: {
            'Content-Type': 'multipart/form-data',
        }
    })
}

/**
 * 
 * @param {*} data 
 * @returns 
 */
//大概思路：放弃formData方式传输二进制文件流
export const uploadImg2 = (data) => {
    return request({
        url: '/Upload/image',
        method: 'post',
        data,
        headers: {
            "Content-Type": "application/octet-stream",
        },
        responseType: "blob",
    })
}


/**
 * 
 * @param {*} data 
 * @returns 
 * 上传视频
 */
export const uploadVideo = (data) => {
    return request({
        url: '/Upload/video',
        method: 'post',
        data,
        headers: {
            'Content-Type': 'multipart/form-data',
        }
    })
}

